<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html> 
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> 
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]--> 
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> 
<!-- BEGIN HEAD --> 
<head> 
	<title>抽奖系统 - Bone</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewort" /> 
	<%@ include file="/common/css.jsp"%>
	<link href="${ctx}/resource/css/promo.css" rel="stylesheet" type="text/css"/> 
	<link href="${ctx}/resource/css/animate.css" rel="stylesheet" type="text/css"/> 
	<link rel="shortcut icon" href="${ctx}/resource/image/logo2.png">
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed page-full-width">
	<!-- BEGIN HEADER -->
	<%@ include file="/common/header.jsp"%>

	<!-- END HEADER -->
	<!-- BEGIN CONTAINER -->
	<div class="page-container row-fluid">
		<!-- BEGIN PAGE -->
		<div class="page-content no-min-height">
			<!-- BEGIN PAGE CONTAINER-->
			<div class="container-fluid promo-page">
				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">
					<div class="span12">
						<div class="block-grey" style="background:url(${ctx}/resource/image/lotterybg.jpg) center no-repeat">
							<div class="container-fluid">
								<div id="promo_carousel" class="carousel slide">
									<div class="carousel-inner">

										<div class="active item">
											<div class="row-fluid">
												<div class="span2"></div>
												<div class="span4 animated rotateInUpRight">
													<h1>欢迎光临 <br>LOTTERY <font color="#D84A38">SYSTEM</font></h1>
													<p>分享网上各类免费抽奖活动及有奖活动信息,交流免费抽奖活动经验与技巧,免费获得最新抽奖资讯的有奖活动网，我们会筛选真实可靠的有奖活动信息推荐给大家,让更多的人体会到网上中奖的乐趣</p>
													<!-- <p>Lunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut non libero consectetur adipiscing elit magna. Sed et quam lacus. Fusce condimentum eleifend enim a feugiat.</p> -->
													<a href="${ctx}/lottery/lotteryEventPage.do" class="btn red big xlarge">
													新建抽奖
													<i class="icon-file-alt m-icon-white"></i>
													</a>
												</div>
												<div class="span4 animated rotateInDownLeft">
													<a href="${ctx}/lottery/index.do"><img src="${ctx}/resource/image/lotrybg.jpg" alt=""></a>
												</div> 
												
											</div>
										</div>

										<div class="item">
											<div class="row-fluid">
												<div class="span2"></div>
												<div class="span4 animated rotateInUpRight">
													<a href="${ctx}/lottery/index.do"><img src="${ctx}/resource/image/lotrybg2.jpg" alt=""></a>
												</div>
												<div class="span4 animated rotateInDownLeft">
													<h1>LOTTERY <font color="#D84A38">SYSTEM</font></h1>
													<p>每天都会为大家更新最新的抽奖活动,想要知道抽奖活动都有哪些么!这里有最全的每日大抽奖活动,欢迎大家的参与</p>
													<p>多款精致 抽奖系统定制  活动不止 精彩不断……</p>
													<a href="${ctx}/lottery/lotteryEventPage.do" class="btn red big xlarge">
														新建抽奖
														<i class="icon-file-alt m-icon-white"></i>
													</a>
												</div>
												<div class="span2"></div>
											</div>
										</div>
									</div>
									<a class="carousel-control left" href="#promo_carousel" data-slide="prev">
									<i class="m-icon-big-swapleft m-icon-white"></i>
									</a>
									<a class="carousel-control right" href="#promo_carousel" data-slide="next">
									<i class="m-icon-big-swapright m-icon-white"></i>
									</a>
								</div>
							</div>
						</div>
					   
						<div  style="margin-top:40px">
							 
							<div class="span2"></div>
							<div class="span8">
								<!-- BEGIN SAMPLE TABLE PORTLET-->
								<div class="portlet box red">
									<div class="portlet-title">
										<div class="caption"><i class="icon-cogs"></i>最新抽奖</div>
										<div class="tools">
											<a href="javascript:;" class="collapse"></a>
										</div>
									</div>
									<div class="portlet-body" style="background:url(${ctx}/resource/image/lotterybg.jpg) center no-repeat">
										<table class="table table-hover" >
											<thead>
											<tr>
												<th style="text-align: center;min-width:30px">编号</th>
												<th>抽奖主题</th>
												<th style="text-align:center;">抽奖方式</th>
												<th style="text-align:center;">创建时间</th>
												<th style="text-align:left;">创建人</th>
											</tr>
											</thead>
											<tbody>
											<c:forEach items="${lotteryList}" var="lottery"  varStatus="status">
											<tr>
												<td style="text-align:center;">${status.index+1}</td>
												<td title=" <vs:escape value='${lottery.title}'/> ">
													
													<a href="${ctx}/lottery/router/route.do?lid=${lottery.id}"  >
														<c:choose>  
														    <c:when test="${fn:length(lottery.title) > 10}">  
														        <vs:escape value="${fn:substring(lottery.title, 0, 10)}..."	/> 
														    </c:when>  
														   <c:otherwise>  
														         <vs:escape value="${lottery.title}"/> 
														    </c:otherwise>  
														</c:choose>  
													</a>
												</td>
												<td style="text-align:center;">
													<vs:escape value="${lottery.type==1?'炫酷式抽奖':'简约式抽奖'}"/>
												</td>
												<td style="text-align:center;"><fmt:formatDate value="${lottery.createTime}" type="both"/>  </td>
												<td style="text-align:left;">${lottery.name}
													<c:if test="${sessionScope.LOGINED_USER.uid.equals(lottery.uid)}">
														<span><a href="javascript:void(0);" onclick="deleteEvent('${lottery.id}')">删除</a> </span> 
													</c:if>
												</td>
											</tr>
											</c:forEach>
											</tbody>
										</table>
											<div align="center">
												<font size="2">共 ${page.totalPageCount} 页</font> <font
													size="2">第 ${page.pageNow} 页</font> <a
													href="${ctx}/lottery/index.do?pageNow=1">首页</a>
												<c:choose>
													<c:when test="${page.pageNow - 1 > 0}">
														<a
															href="${ctx}/lottery/index.do?pageNow=${page.pageNow - 1}">上一页</a>
													</c:when>
												</c:choose>
												<c:choose>
													<c:when test="${page.totalPageCount==0}">
														<a href="${ctx}/lottery/index.do?pageNow=${page.pageNow}">下一页</a>
													</c:when>
													<c:when test="${page.pageNow + 1 <= page.totalPageCount}">
														<a
															href="${ctx}/lottery/index.do?pageNow=${page.pageNow + 1}">下一页</a>
													</c:when>
												</c:choose>
												<c:choose>
													<c:when test="${page.totalPageCount==0}">
														<a href="${ctx}/lottery/index.do?pageNow=${page.pageNow}">尾页</a>
													</c:when>
													<c:otherwise>
														<a
															href="${ctx}/lottery/index.do?pageNow=${page.totalPageCount}">尾页</a>
													</c:otherwise>
												</c:choose>
											</div>
										
									</div>
								</div>
							</div>
					</div>
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
		</div>
		<!-- END PAGE CONTAINER-->
	</div>
	<!-- END PAGE -->
	<!-- END CONTAINER -->
	
	<!-- BEGIN FOOTER1 -->
	<%@ include file="/common/footer.jsp"%>
	<!-- END FOOTER -->
	
	<!-- BEGIN JAVASCRIPTS -->
	<%@ include file="/common/js.jsp"%>
	<script src="${ctx}/resource/js/app.js"></script>
	<script>
		function deleteEvent(lid) {
		   layer.confirm('确定要删除吗？', {
			   btn: ['确定','取消']
			 }, function(){
				 $.post("${ctx}/lottery/delete.do", {lid: lid}, function(data,status){
		    			if(!data.flag) {
		 	    			layer.msg(data.msg);
		 	    			window.location.reload();
		    			}
		   			});
			 });
	   	}
		jQuery(document).ready(function() {
		   App.init();
		   jQuery('#promo_carousel').carousel({
		      interval: 10000,
		      pause: 'hover'
		   });
		   
		   $("#search_btn").click(function(){
		   	 var searchVal=$("#inputSuccess").val();	
		   	 $("#inputSuccess").val($.trim(searchVal));   
		  	 $("#searchForm").attr("action","${ctx}/lottery/list.do");
		  	  $("#searchForm").submit();
		   });
		});
	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>